<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">
<title>用户管理信息修改</title>
</head>
<body>
	<form id="user-edit-form" action="userServlet.do?method=update"
		method="post">
		 <input type="hidden" name="id">
		<div class="datagrid-body">
			<table class="datagrid-btable" cellspacing="0" cellpadding="0"
				border="0" style="width: 100%;">
				<tbody>
					<!-- <tr class="datagrid-row">
						<td
							style="border-style: solid; width: 15%; text-align: right; padding-right: 7px">部门编码</td>
						<td style="border-style: solid; width: 35%; text-align: left;">
							<input type="text" name="departmentNum"
							class="easyui-validatebox" style="width: 230px">
						</td>
					</tr> -->
					 <tr class="datagrid-row">
						<td
							style="border-style: solid; width: 15%; text-align: right; padding-right: 7px">部门名称</td>
						<td style="border-style: solid; width: 35%; text-align: left;">
<!-- 							<input type="text" name="deptName" -->
<!-- 							class="easyui-validatebox" style="width: 230px"> -->
							<input style="width: 230px;" name="departmentNum" class="easyui-combobox" data-options="url:'departmentServlet.do?method=queryAll',textField:'departmentName',valueField:'departmentNum',required:true">
						</td>
					</tr>
        
					<tr class="datagrid-row">
						<td
							style="border-style: solid; width: 15%; text-align: right; padding-right: 7px">用户登录编码</td>
						<td style="border-style: solid; width: 35%; text-align: left;">
							
							<input type="text" name="userNum" 
							class="easyui-validatebox"  style="width: 230px">
						</td>
					</tr>
					<tr class="datagrid-row">
						<td
							style="border-style: solid; width: 15%; text-align: right; padding-right: 7px">用户昵称</td>
						<td style="border-style: solid; width: 35%; text-align: left;">
							<input type="text" name="userName"
							class="easyui-validatebox" style="width: 230px">
						</td>
					</tr>
				</tbody>
			</table>
		</div>
	</form>
	<script type="text/javascript">
function getQueryParam(name) {
     var obj = $('#common-dialog').dialog('options');
     var queryParams = obj["queryParams"];
     return queryParams[name];
}
//自动填充值
function autoInput(obj){
 	$.each(obj, function(i, n){
 		debugger;
		var $var = $("#user-edit-form input[name='"+i+"']");
		if($var.attr("type")=="text" ||$var.attr("type")=="hidden"){
			$var.val(n);
		}
 	});
}
$(function(){
	var _id  =getQueryParam("id");
	$.getJSON("userServlet.do?method=edit",{id:_id},function(json){
			//自动添值
		  autoInput(json);
	});
	 $("#user-edit-form .easyui-validatebox")
     .validatebox({
         required:true,
         novalidate:true
     })
     .focus(function(){
         $(this).validatebox({novalidate:false});
     }).blur(function(){
     $(this).validatebox({novalidate:false});
 });
});
</script>
</body>
</html>